<script setup lang="ts">
import { inject, onMounted, toRef, defineExpose, reactive, watch } from 'vue'
import  chartBuild  from '@/components/chartbuilds/index'
let echarts = inject('ec')
const props = defineProps({
  width: Number,
  height: Number,
  type:String,
  id:Number
})
const drawLine = () => {
  let myChart = echarts.init(document.getElementById(`echarts${props.id}`))
  myChart.setOption(chartBuild.build(props.type))
  myChart.resize()
}

onMounted(() => {
  drawLine()
})
</script>
<template>
  <div :id="`echarts${props.id}`" :style="{ width: `${props.width}px`, height:`${props.height}px` }"></div>
</template>
<style lang="scss" scoped>
</style>